<template>
	<view class="beijingse">
		<header-top :messageInfo="{typeFlag:true,message:'收益明细',liner:false}"></header-top>
		<view class="flexcenter ffffff">
			<u-tabs :list="list1" lineColor="#FD463E" @click="clicktabtow" :activeStyle="{
			    color: ' #333333',
			    fontWeight: 'bold',
			    transform: 'scale(1.05)'
			}" :inactiveStyle="{
			            color: '#999999',
						 fontWeight: 'bold',
			            transform: 'scale(1)'
			        }" itemStyle="padding-left: 30px; padding-right: 30px; height: 44px;"></u-tabs>
		</view>
		<view class="mainpadding">
			<!-- 内容 -->
			<view class="" v-if="list.data.length==0">
				<view class="kym" v-if="!list.data.length">
					<image src="../../static/image/system/zwsj.png" mode=""></image>
				</view>
			</view>
			<view class="ffffff radius mainpadding margin_top" v-for="item in list.data" :key="item.id">
				<view class="flexbetween xiahuax">
					<view class="strongtext">订单编号：{{item.order_goods_no}}</view>
					<view class="huisetext" v-if="item.status==3">已取消</view>
					<view class="lvsetext" v-if="item.status==2">已完成</view>
					<view class="huangsetext" v-if="item.status==1">待结算</view>
					<!-- <view class="huangsetext">已付款，待发货</view> -->
					<!-- <view class="huangsetext">已发货，待收货</view> -->
				</view>
				<view class="flexbetween margin_top">
					<view class="flexleft">
						<view class="shilitu margin_right3">
							<image :src="item.l_userinfo.avatar_text" mode=""></image>
						</view>
						<view class="">
							<view class="titletext">{{item.l_userinfo.nickname}}</view>
							<view class="nostrongtext margin_top">{{item.l_userinfo.createtime_text}}</view>
						</view>
					</view>
					<view class="qianshu">+{{item.price}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				currenttabtow: 0,
				list1: [{
						name: '全部',
					},
					{
						name: '未结算',
					},
					{
						name: '已结算',
					},
				],
				status: 0,
				page: 1,
				limit: 10,
				list: {
					data: [],
				},
			}
		},
		onLoad() {
			this.getdata();
		},
		methods: {
			getdata(isPage, page) {
				let _this = this;
				httpRequest.request('api/user/userCommission', 'POST', {
					page: page || 1,
					limit: _this.limit,
					status: _this.status,
				}).then(res => {
					if (res.code == 1) {
						let resList = res.data.data;
						if (isPage == true) {
							_this.list.data.push(...resList);
						} else {
							_this.list = res.data
							_this.list.data = resList;
						}
					}
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.total <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.getdata(true, page);
			},
			clicktabtow(e) {
				console.log(e);
				this.status = e.index;
				this.currenttabtow = e.index;
				this.getdata();
			},
		}
	}
</script>

<style lang="scss" scoped>
	.kym {
		margin: 250rpx auto 0;
		width: 343rpx;
		height: 324rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.kong {
		height: 60vh;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.qianshu {
		font-size: 30rpx;
		font-family: DIN Next LT Pro-Bold, DIN Next LT Pro;
		font-weight: bold;
		color: #FD463E;
	}

	.xiahuax {
		padding-bottom: 20rpx;
		border-bottom: 1rpx solid rgba(153, 153, 153, .1);
	}

	.shilitu {
		width: 124rpx;
		height: 124rpx;
		border-radius: 50%;

		image {
			width: 100%;
			height: 100%;
			border-radius: 50%;
		}
	}

	.huangsetext {
		font-size: 24rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #FF8110;
	}

	.lvsetext {
		font-size: 24rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #50B674;
	}

	.huisetext {
		font-size: 24rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #666666;
	}
</style>
